import axios from "@/utils/axios";

//分页
export function getRoleList(params) {
    return axios({
        url: '/sys/role/list',
        method: "GET",
        params
    })
}

//获取所有角色
export function getRoleListInfo() {
    return axios({
        url: '/sys/role/RoleList',
        method: 'GET'
    })
}

//通过id获取用户权限
export function getPermissionListById(params) {
    return axios({
        url: '/sys/role/info/' + params,
        method: 'GET',
    })
}

//授权表单确定
export function assignPermissions(data) {
    return axios({
        url: '/sys/role/permission/' + data.roleId,
        method: "POST",
        data: data.menuIds
    })
}

//新增或更新角色信息
export function save(data) {
    return axios({
        url: '/sys/role/save',
        method: 'POST',
        data
    })
}

//删除角色
export function delRole(data) {
    return axios({
        url: '/sys/role/delete',
        method: 'POST',
        data: data
    })
}
